/**
 * 
 */
package com.skood.security.service.impl;

import java.util.List;

import org.springframework.stereotype.Service;

import com.skood.common.dao.CommonDAO;
import com.skood.common.service.AbstractService;
import com.skood.security.dao.ResourceDAO;
import com.skood.security.domain.Resource;
import com.skood.security.service.ResourceService;

/**
 * @author keege
 * @date 2013-12-13
 */
@Service("resourceService")
public class ResourceServiceImpl extends AbstractService<Resource> implements ResourceService {

	@javax.annotation.Resource(name = "resourceDAO")
	private ResourceDAO resourceDAO;
	@Override
	protected CommonDAO<Resource> getDAO() {
		// TODO Auto-generated method stub
		return resourceDAO;
	}

	@Override
	public List<Resource> getAll() {
		// TODO Auto-generated method stub
		return resourceDAO.getAll();
	}

	@Override
	public List<Resource> getChildren(Long id) {
		// TODO Auto-generated method stub
		return resourceDAO.getChildren(id);
	}

	public List<Resource> getDescendants(Long id) {
		return resourceDAO.getDescendants(id);
	}


	@Override
	public List<Resource> getResourcesByRole(Long roleId) {
		// TODO Auto-generated method stub
		return resourceDAO.getResourcesByRole(roleId);
	}
}
